<?php
class Usuario extends MODEL{
	function Usuario(){
		$this->keyField = 'cod_usuario';
		$this->addField('nom_login','Login');
		$this->addField('dsc_senha','Senha');
	}
	
	public function fetching(){
		$this->id_usuario = $this->getRowValue('cod_usuario');
	}
	
	public function getIdByLogin($user = '', $password = ''){
		$parametros = array('pusuario' => $user, 'psenha'=>$password);
		$this->query('
			SELECT cod_usuario 
			FROM usuario 
			WHERE nom_login = :pusuario and dsc_senha = :psenha'
			,$parametros
		);
	}
	
}